<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/style.css"/>
	</head>
	<style type="text/css">
		.top-ul li {
			line-height: 2.625rem;
		}
	</style>
	<body>
		<header class="mui-bar mui-bar-nav header">
			<h1 class="mui-title">通讯录</h1>
		</header>
		<div class="mui-content">
			<div class="mui-input-row mui-search search">
				<input type="search" class="mui-input-speech" placeholder="通讯录">
			</div>
			<ul class="mui-table-view top-ul">
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="img/1.png">
						<div class="mui-media-body">
							新的朋友
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="img/1.png">
						<div class="mui-media-body">
							群聊
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="img/1.png">
						<div class="mui-media-body">
							标签
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="img/1.png">
						<div class="mui-media-body">
							公众号
						</div>
					</a>
				</li>
			</ul>
			<ul class="mui-table-view" id="address">
					<li class="mui-table-view-cell">
						<a class="mui-navigate-right">
							名称:<em></em>
						</a>
					</li>
				</ul>
		</div>
		
		<script src="js/mui.js"></script>
		<script type="text/javascript">
			mui.init()
			mui.plusReady(function() {
				var str = '';
				plus.contacts.getAddressBook( plus.contacts.ADDRESSBOOK_PHONE, function(address) {
					address.find(null, function(data) {
						for(var i = 0; i<data.length; i++) {
							str += `<li class="mui-table-view-cell">
											<a class="mui-navigate-right">`
									str += data[i].displayName + '<em><b>'+data[i].phoneNumbers[0].value+'</b></em>'
									str += `</a>
										</li>`
						}
						mui('#address')[0].innerHTML = str;
						
					})
				});
			})
		</script>
	</body>

</html>
